package com.hmdp.controller;


import cn.hutool.core.collection.SpliteratorUtil;
import com.hmdp.dto.Result;
import com.hmdp.service.IFollowService;
import jdk.jfr.Timespan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 */
@RestController
@RequestMapping("/follow")
public class FollowController {

    @Autowired
    private IFollowService iFollowService;

    @PutMapping("/{id}/{flag}")
    public Result followme(@PathVariable("id") Long id, @PathVariable("flag") boolean flag) {
        return iFollowService.followme(id, flag);
    }
    @GetMapping("/or/not/{id}")
    public Result followOrNot(@PathVariable("id") Long id){
       return iFollowService.followOrNot(id);
    }
    @GetMapping("/common/{id}")
    public Result followEach(@PathVariable("id") Long id){
        return iFollowService.followEach(id);
    }
}
